class ListNode:
  def __init__(self, x):
    self.val = x
    self.next = None


class Solution:
  def reversePrint(self, head: ListNode) -> list:
    res = []
    while head is not None:
      res.insert(0, head.val)
      head = head.next
    return res


'''
STATUS: SOLVED
TRIES:  1
TIME:   60 MS
MEMORY: 15.4 MB
'''
if __name__ == "__main__":
    solution = Solution()
    head = ListNode(1)
    head.next = ListNode(3)
    head.next.next = ListNode(2)
    print(solution.reversePrint(head))
